﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Xml;

namespace OffInvoiceExcelAddIn.FacturaeFiles
{
    /// <summary>
    /// Clase serializable que representa la estructura de la facturae
    /// </summary>
    /// <remarks>
    /// Contiene los distintos tipos de objetos a utilizar para la generación de la factura
    /// </remarks>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    //[XmlRootAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae", IsNullable = false)]
    public partial class Facturae
    {
        private FileHeaderType fileHeaderField;

        private PartiesType partiesField;

        private List<InvoiceType> invoicesField;

        private ExtensionsType extensionsField;

        public Facturae()
        {
            fileHeaderField = new FileHeaderType();
            partiesField = new PartiesType();
            invoicesField = new List<InvoiceType>();
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public FileHeaderType FileHeader
        {
            get
            {
                return this.fileHeaderField;
            }
            set
            {
                this.fileHeaderField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PartiesType Parties
        {
            get
            {
                return this.partiesField;
            }
            set
            {
                this.partiesField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Invoice", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<InvoiceType> Invoices
        {
            get
            {
                return this.invoicesField;
            }
            set
            {
                this.invoicesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ExtensionsType Extensions
        {
            get
            {
                return this.extensionsField;
            }
            set
            {
                this.extensionsField = value;
            }
        }
    }

    /// <summary>
    /// Clase utilizada dentro de la Clase Facturae, Representacion de .net para el encabezado del documneto xml de una Facturae
    /// </summary>
    /// <remarks>
    /// Especifica:
    /// Version del esquema, modalidad, tipo de emisor, datos del tercero, e informacion referente al lote de facturas
    /// </remarks>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class FileHeaderType
    {

        private SchemaVersionType schemaVersionField;

        private ModalityType modalityField;

        private InvoiceIssuerTypeType InvoiceIssuerTypeField;

        private ThirdPartyType thirdPartyField;

        private BatchType batchField;

        private FactoringAssignmentDataType factoringAssignmentDataField;

        public FileHeaderType()
        {
            this.schemaVersionField = SchemaVersionType.Item31;
            this.InvoiceIssuerTypeField = new InvoiceIssuerTypeType();
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public SchemaVersionType SchemaVersion
        {
            get
            {
                return this.schemaVersionField;
            }
            set
            {
                this.schemaVersionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ModalityType Modality
        {
            get
            {
                return this.modalityField;
            }
            set
            {
                this.modalityField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceIssuerTypeType InvoiceIssuerType
        {
            get
            {
                return this.InvoiceIssuerTypeField;
            }
            set
            {
                this.InvoiceIssuerTypeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ThirdPartyType ThirdParty
        {
            get
            {
                return this.thirdPartyField;
            }
            set
            {
                this.thirdPartyField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public BatchType Batch
        {
            get
            {
                return this.batchField;
            }
            set
            {
                this.batchField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public FactoringAssignmentDataType FactoringAssignmentData
        {
            get
            {
                return this.factoringAssignmentDataField;
            }
            set
            {
                this.factoringAssignmentDataField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda el tipo de version del esquema de facturae. 
    /// a la fecha existen dos tipos el V3.0 y el V3.1, para efectos de la facturae generada con la aplicación se utiliza el segundo
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum SchemaVersionType
    {


        [XmlEnumAttribute("3.1")]
        Item31,
        [XmlEnumAttribute("3.2")]
        Item32,
    }

    /// <summary>
    /// Enumerado que brinda los tipos de modalidad de la factura: Individual (I) ó Lote (L)
    /// Para efectos de la aplicacion se utilizará siempre la modalidad (I) por lo que el valor para 
    /// el campo InvoicesCount de la clase Batch siempre sera 1
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum ModalityType
    {

        /// <summary>
        /// Individual
        /// </summary>
        I,
        /// <summary>
        /// Lote
        /// </summary>

        L,
    }

    /// <summary>
    /// Enumerado que brinda los tres tipos de emisor ó firmante de una factura:
    /// Emisor (E) en facturas de clientes, Receptor en facturas de provedores (RE), ó Tercero en facturas generadas por una ente externo (TE)
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum InvoiceIssuerTypeType
    {

        /// <summary>
        /// Emisor
        /// </summary>
        EM,

        /// <summary>
        /// Receptor
        /// </summary>
        RE,

        /// <summary>
        /// Tercero
        /// </summary>
        TE,
    }

    /// <summary>
    /// Clase que representa la estructura de la sección de datos del tercero, en caso de que el valor del campo InvoiceIssuerType sea "TE"
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ThirdPartyType
    {

        private TaxIdentificationType taxIdentificationField;

        private object itemField;

        public ThirdPartyType()
        {
            taxIdentificationField = new TaxIdentificationType();

        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxIdentificationType TaxIdentification
        {
            get
            {
                return this.taxIdentificationField;
            }
            set
            {
                this.taxIdentificationField = value;
            }
        }


        [XmlElementAttribute("Individual", typeof(IndividualType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("LegalEntity", typeof(LegalEntityType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa informacion de identificacion de las partes envueltas en la factura emisor, cliente o receptor ó tercero
    /// <para>Especifica campos como tipo de persona, tipo de residente, NIF</para>
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class TaxIdentificationType
    {

        private PersonTypeCodeType personTypeCodeField;

        private ResidenceTypeCodeType residenceTypeCodeField;

        private string taxIdentificationNumberField;

        public TaxIdentificationType()
        {

        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PersonTypeCodeType PersonTypeCode
        {
            get
            {
                return this.personTypeCodeField;
            }
            set
            {
                this.personTypeCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ResidenceTypeCodeType ResidenceTypeCode
        {
            get
            {
                return this.residenceTypeCodeField;
            }
            set
            {
                this.residenceTypeCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TaxIdentificationNumber
        {
            get
            {
                return this.taxIdentificationNumberField;
            }
            set
            {
                this.taxIdentificationNumberField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los tipos de persona
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum PersonTypeCodeType
    {

        /// <summary>
        /// Persona físisca
        /// </summary>
        F,
        /// <summary>
        /// Persona Jurídica
        /// </summary>
        J,
    }

    /// <summary>
    /// Enumerado que brinda los tipos de residente
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum ResidenceTypeCodeType
    {

        /// <summary>
        /// Extranjero
        /// </summary>
        E,

        /// <summary>
        /// Residente
        /// </summary>
        R,

        /// <summary>
        /// Residente en la Union Europea
        /// </summary>
        U,
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AttachmentType
    {

        private AttachmentCompressionAlgorithmType attachmentCompressionAlgorithmField;

        private bool attachmentCompressionAlgorithmFieldSpecified;

        private AttachmentFormatType attachmentFormatField;

        private AttachmentEncodingType attachmentEncodingField;

        private bool attachmentEncodingFieldSpecified;

        private string attachmentDescriptionField;

        private string attachmentDataField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AttachmentCompressionAlgorithmType AttachmentCompressionAlgorithm
        {
            get
            {
                return this.attachmentCompressionAlgorithmField;
            }
            set
            {
                this.attachmentCompressionAlgorithmField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool AttachmentCompressionAlgorithmSpecified
        {
            get
            {
                return this.attachmentCompressionAlgorithmFieldSpecified;
            }
            set
            {
                this.attachmentCompressionAlgorithmFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AttachmentFormatType AttachmentFormat
        {
            get
            {
                return this.attachmentFormatField;
            }
            set
            {
                this.attachmentFormatField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AttachmentEncodingType AttachmentEncoding
        {
            get
            {
                return this.attachmentEncodingField;
            }
            set
            {
                this.attachmentEncodingField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool AttachmentEncodingSpecified
        {
            get
            {
                return this.attachmentEncodingFieldSpecified;
            }
            set
            {
                this.attachmentEncodingFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AttachmentDescription
        {
            get
            {
                return this.attachmentDescriptionField;
            }
            set
            {
                this.attachmentDescriptionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AttachmentData
        {
            get
            {
                return this.attachmentDataField;
            }
            set
            {
                this.attachmentDataField = value;
            }
        }
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum AttachmentCompressionAlgorithmType
    {


        ZIP,


        GZIP,


        NONE,
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum AttachmentFormatType
    {


        xml,


        doc,


        gif,


        rtf,


        pdf,


        xls,


        jpg,


        bmp,


        tiff,
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum AttachmentEncodingType
    {


        BASE64,


        BER,


        DER,


        NONE,
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AdditionalDataType
    {

        private string relatedInvoiceField;

        private List<AttachmentType> relatedDocumentsField;

        private string invoiceAdditionalInformationField;

        private ExtensionsType extensionsField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string RelatedInvoice
        {
            get
            {
                return this.relatedInvoiceField;
            }
            set
            {
                this.relatedInvoiceField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Attachment", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<AttachmentType> RelatedDocuments
        {
            get
            {
                return this.relatedDocumentsField;
            }
            set
            {
                this.relatedDocumentsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceAdditionalInformation
        {
            get
            {
                return this.invoiceAdditionalInformationField;
            }
            set
            {
                this.invoiceAdditionalInformationField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ExtensionsType Extensions
        {
            get
            {
                return this.extensionsField;
            }
            set
            {
                this.extensionsField = value;
            }
        }
    }

    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ExtensionsType
    {

        private List<XmlElement> anyField;


        [XmlAnyElementAttribute()]
        public List<XmlElement> Any
        {
            get
            {
                return this.anyField;
            }
            set
            {
                this.anyField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AccountType
    {

        private string iBANField;

        private string bankCodeField;

        private string branchCodeField;

        private object itemField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string IBAN
        {
            get
            {
                return this.iBANField;
            }
            set
            {
                this.iBANField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string BankCode
        {
            get
            {
                return this.bankCodeField;
            }
            set
            {
                this.bankCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string BranchCode
        {
            get
            {
                return this.branchCodeField;
            }
            set
            {
                this.branchCodeField = value;
            }
        }


        [XmlElementAttribute("BranchInSpainAddress", typeof(AddressType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("OverseasBranchAddress", typeof(OverseasAddressType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa la base para los apartados de dirección, tanto para AddressInSpain, como para OverSeasAddress
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AddressType
    {
        /// <summary>
        /// Dirección completa
        /// </summary>
        private string addressField;

        /// <summary>
        /// Código Postal
        /// </summary>
        private string postCodeField;

        /// <summary>
        /// Población
        /// </summary>
        private string townField;

        /// <summary>
        /// Provincia
        /// </summary>
        private string provinceField;

        /// <summary>
        /// Código de País
        /// </summary>
        private CountryType countryCodeField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Address
        {
            get
            {
                return this.addressField;
            }
            set
            {
                this.addressField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PostCode
        {
            get
            {
                return this.postCodeField;
            }
            set
            {
                this.postCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Town
        {
            get
            {
                return this.townField;
            }
            set
            {
                this.townField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Province
        {
            get
            {
                return this.provinceField;
            }
            set
            {
                this.provinceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CountryType CountryCode
        {
            get
            {
                return this.countryCodeField;
            }
            set
            {
                this.countryCodeField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los códigos de país contemplados por el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum CountryType
    {


        AFG,


        ALB,


        DZA,


        ASM,


        AND,


        AGO,


        AIA,


        ATG,


        ARG,


        ARM,


        ABW,


        AUS,


        AUT,


        AZE,


        BHS,


        BHR,


        BGD,


        BRB,


        BLR,


        BEL,


        BLZ,


        BEN,


        BMU,


        BTN,


        BOL,


        BIH,


        BWA,


        BRA,


        BRN,


        BGR,


        BFA,


        BDI,


        KHM,


        CMR,


        CAN,


        CPV,


        CYM,


        CAF,


        TCD,


        CHL,


        CHN,


        COD,


        COL,


        COM,


        COG,


        COK,


        CRI,


        CIV,


        HRV,


        CUB,


        CYP,


        CZE,


        DNK,


        DJI,


        DMA,


        DOM,


        ECU,


        EGY,


        SLV,


        GNQ,


        ERI,


        EST,


        ETH,


        FLK,


        FRO,


        FJI,


        FIN,


        FRA,


        GUF,


        PYF,


        GAB,


        GMB,


        GEO,


        GGY,


        DEU,


        GHA,


        GIB,


        GRC,


        GRL,


        GRD,


        GLP,


        GUM,


        GTM,


        GIN,


        GNB,


        GUY,


        HTI,


        HND,


        HKG,


        HUN,


        ISL,


        IND,


        IDN,


        IMN,


        IRN,


        IRQ,


        IRL,


        ISR,


        ITA,


        JAM,


        JEY,


        JPN,


        JOR,


        KAZ,


        KEN,


        KIR,


        PRK,


        KOR,


        KWT,


        KGZ,


        LAO,


        LVA,


        LBN,


        LSO,


        LBR,


        LBY,


        LIE,


        LTU,


        LUX,


        MAC,


        MKD,


        MDG,


        MWI,


        MYS,


        MDV,


        MLI,


        MLT,


        MHL,


        MTQ,


        MRT,


        MUS,


        MYT,


        MEX,


        FSM,


        MDA,


        MCO,


        MNE,


        MNG,


        MSR,


        MAR,


        MOZ,


        MMR,


        NAM,


        NRU,


        NPL,


        NLD,


        ANT,


        NCL,


        NZL,


        NIC,


        NER,


        NGA,


        NIU,


        NFK,


        MNP,


        NOR,


        OMN,


        PAK,


        PLW,


        PAN,


        PNG,


        PRY,


        PSE,


        PER,


        PHL,


        PCN,


        POL,


        PRT,


        PRI,


        QAT,


        REU,


        ROU,


        RUS,


        RWA,


        KNA,


        LCA,


        VCT,


        WSM,


        SMR,


        STP,


        SAU,


        SEN,


        SRB,


        SYC,


        SLE,


        SGP,


        SVK,


        SVN,


        SLB,


        SOM,


        ZAF,


        ESP,


        LKA,


        SHN,


        SPM,


        SDN,


        SUR,


        SJM,


        SWZ,


        SWE,


        CHE,


        SYR,


        TWN,


        TJK,


        TZA,


        THA,


        TGO,


        TKL,


        TON,


        TTO,


        TUN,


        TUR,


        TKM,


        TLS,


        TCA,


        TUV,


        UGA,


        UKR,


        ARE,


        GBR,


        USA,


        URY,


        UZB,


        VUT,


        VAT,


        VEN,


        VNM,


        VGB,


        VIR,


        WLF,


        ESH,


        YEM,


        ZAR,


        ZMB,


        ZWE,
    }
    /// <summary>
    /// Tipo de Dirección que se utiliza para las partes(SellerParty, BuyerParty, ThirdParty), cuyo código de país es diferente a ESP
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class OverseasAddressType
    {

        private string addressField;

        private string postCodeAndTownField;

        private string provinceField;

        private CountryType countryCodeField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Address
        {
            get
            {
                return this.addressField;
            }
            set
            {
                this.addressField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PostCodeAndTown
        {
            get
            {
                return this.postCodeAndTownField;
            }
            set
            {
                this.postCodeAndTownField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Province
        {
            get
            {
                return this.provinceField;
            }
            set
            {
                this.provinceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CountryType CountryCode
        {
            get
            {
                return this.countryCodeField;
            }
            set
            {
                this.countryCodeField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa al bloque de información del pago de la factura, 
    /// contempla aspectos como: fecha de pago, importe a pagar, medio de pago, datos de la cuenta y otros.
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InstallmentType
    {

        private DateTime installmentDueDateField;

        private string installmentAmountField;

        private string paymentMeansField;

        private AccountType accountToBeCreditedField;

        private string paymentReconciliationReferenceField;

        private AccountType accountToBeDebitedField;

        private string collectionAdditionalInformationField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime InstallmentDueDate
        {
            get
            {
                return this.installmentDueDateField;
            }
            set
            {
                this.installmentDueDateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InstallmentAmount
        {
            get
            {
                return this.installmentAmountField;
            }
            set
            {
                this.installmentAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PaymentMeans
        {
            get
            {
                return this.paymentMeansField;
            }
            set
            {
                this.paymentMeansField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AccountType AccountToBeCredited
        {
            get
            {
                return this.accountToBeCreditedField;
            }
            set
            {
                this.accountToBeCreditedField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PaymentReconciliationReference
        {
            get
            {
                return this.paymentReconciliationReferenceField;
            }
            set
            {
                this.paymentReconciliationReferenceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AccountType AccountToBeDebited
        {
            get
            {
                return this.accountToBeDebitedField;
            }
            set
            {
                this.accountToBeDebitedField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string CollectionAdditionalInformation
        {
            get
            {
                return this.collectionAdditionalInformationField;
            }
            set
            {
                this.collectionAdditionalInformationField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda el código para los diferentes tipos de pago contemplados en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum PaymentMeansType
    {


        [XmlEnumAttribute("01")]
        Item01,


        [XmlEnumAttribute("02")]
        Item02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,


        [XmlEnumAttribute("05")]
        Item05,


        [XmlEnumAttribute("06")]
        Item06,


        [XmlEnumAttribute("07")]
        Item07,


        [XmlEnumAttribute("08")]
        Item08,


        [XmlEnumAttribute("09")]
        Item09,


        [XmlEnumAttribute("10")]
        Item10,


        [XmlEnumAttribute("11")]
        Item11,


        [XmlEnumAttribute("12")]
        Item12,


        [XmlEnumAttribute("13")]
        Item13,


        [XmlEnumAttribute("14")]
        Item14,


        [XmlEnumAttribute("15")]
        Item15,


        [XmlEnumAttribute("16")]
        Item16,


        [XmlEnumAttribute("17")]
        Item17,


        [XmlEnumAttribute("18")]
        Item18,


        [XmlEnumAttribute("19")]
        Item19,
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class DeliveryNoteType
    {

        private string deliveryNoteNumberField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string DeliveryNoteNumber
        {
            get
            {
                return this.deliveryNoteNumberField;
            }
            set
            {
                this.deliveryNoteNumberField = value;
            }
        }
    }

    /// <summary>
    /// clase que representa las lineas de detalle dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceLineType
    {

        private string issuerContractReferenceField;

        private string issuerTransactionReferenceField;

        private string receiverContractReferenceField;

        private string receiverTransactionReferenceField;

        private string purchaseOrderReferenceField;

        private bool purchaseOrderReferenceFieldSpecified;

        private List<DeliveryNoteType> deliveryNotesReferencesField;

        private string itemDescriptionField;

        private string quantityField;

        private UnitOfMeasureType unitOfMeasureField;

        private bool unitOfMeasureFieldSpecified;

        private string unitPriceWithoutTaxField;

        private string totalCostField;

        private List<DiscountType> discountsAndRebatesField;

        private List<ChargeType> chargesField;

        private string grossAmountField;

        private List<TaxType> taxesWithheldField;

        private List<InvoiceLineTypeTax> taxesOutputsField;

        private PeriodDates lineItemPeriodField;

        private DateTime transactionDateField;

        private bool transactionDateFieldSpecified;

        private string additionalLineItemInformationField;

        private ExtensionsType extensionsField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string IssuerContractReference
        {
            get
            {
                return this.issuerContractReferenceField;
            }
            set
            {
                this.issuerContractReferenceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string IssuerTransactionReference
        {
            get
            {
                return this.issuerTransactionReferenceField;
            }
            set
            {
                this.issuerTransactionReferenceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ReceiverContractReference
        {
            get
            {
                return this.receiverContractReferenceField;
            }
            set
            {
                this.receiverContractReferenceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ReceiverTransactionReference
        {
            get
            {
                return this.receiverTransactionReferenceField;
            }
            set
            {
                this.receiverTransactionReferenceField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PurchaseOrderReference
        {
            get
            {
                return this.purchaseOrderReferenceField;
            }
            set
            {
                this.purchaseOrderReferenceField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool PurchaseOrderReferenceSpecified
        {
            get
            {
                return this.purchaseOrderReferenceFieldSpecified;
            }
            set
            {
                this.purchaseOrderReferenceFieldSpecified = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("DeliveryNote", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<DeliveryNoteType> DeliveryNotesReferences
        {
            get
            {
                return this.deliveryNotesReferencesField;
            }
            set
            {
                this.deliveryNotesReferencesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ItemDescription
        {
            get
            {
                return this.itemDescriptionField;
            }
            set
            {
                this.itemDescriptionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Quantity
        {
            get
            {
                return this.quantityField;
            }
            set
            {
                this.quantityField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public UnitOfMeasureType UnitOfMeasure
        {
            get
            {
                return this.unitOfMeasureField;
            }
            set
            {
                this.unitOfMeasureField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool UnitOfMeasureSpecified
        {
            get
            {
                return this.unitOfMeasureFieldSpecified;
            }
            set
            {
                this.unitOfMeasureFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string UnitPriceWithoutTax
        {
            get
            {
                return this.unitPriceWithoutTaxField;
            }
            set
            {
                this.unitPriceWithoutTaxField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalCost
        {
            get
            {
                return this.totalCostField;
            }
            set
            {
                this.totalCostField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Discount", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<DiscountType> DiscountsAndRebates
        {
            get
            {
                return this.discountsAndRebatesField;
            }
            set
            {
                this.discountsAndRebatesField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Charge", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<ChargeType> Charges
        {
            get
            {
                return this.chargesField;
            }
            set
            {
                this.chargesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string GrossAmount
        {
            get
            {
                return this.grossAmountField;
            }
            set
            {
                this.grossAmountField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Tax", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<TaxType> TaxesWithheld
        {
            get
            {
                return this.taxesWithheldField;
            }
            set
            {
                this.taxesWithheldField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Tax", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<InvoiceLineTypeTax> TaxesOutputs
        {
            get
            {
                return this.taxesOutputsField;
            }
            set
            {
                this.taxesOutputsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PeriodDates LineItemPeriod
        {
            get
            {
                return this.lineItemPeriodField;
            }
            set
            {
                this.lineItemPeriodField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime TransactionDate
        {
            get
            {
                return this.transactionDateField;
            }
            set
            {
                this.transactionDateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TransactionDateSpecified
        {
            get
            {
                return this.transactionDateFieldSpecified;
            }
            set
            {
                this.transactionDateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AdditionalLineItemInformation
        {
            get
            {
                return this.additionalLineItemInformationField;
            }
            set
            {
                this.additionalLineItemInformationField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ExtensionsType Extensions
        {
            get
            {
                return this.extensionsField;
            }
            set
            {
                this.extensionsField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los códigos para las diferentes unidades de medida, contemplados en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum UnitOfMeasureType
    {


        [XmlEnumAttribute("01")]
        Item01,


        [XmlEnumAttribute("02")]
        Item02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,


        [XmlEnumAttribute("05")]
        Item05,


        [XmlEnumAttribute("06")]
        Item06,


        [XmlEnumAttribute("07")]
        Item07,


        [XmlEnumAttribute("08")]
        Item08,


        [XmlEnumAttribute("09")]
        Item09,


        [XmlEnumAttribute("10")]
        Item10,


        [XmlEnumAttribute("11")]
        Item11,


        [XmlEnumAttribute("12")]
        Item12,


        [XmlEnumAttribute("13")]
        Item13,


        [XmlEnumAttribute("14")]
        Item14,


        [XmlEnumAttribute("15")]
        Item15,


        [XmlEnumAttribute("16")]
        Item16,


        [XmlEnumAttribute("17")]
        Item17,


        [XmlEnumAttribute("18")]
        Item18,


        [XmlEnumAttribute("19")]
        Item19,


        [XmlEnumAttribute("20")]
        Item20,


        [XmlEnumAttribute("21")]
        Item21,


        [XmlEnumAttribute("22")]
        Item22,


        [XmlEnumAttribute("23")]
        Item23,


        [XmlEnumAttribute("24")]
        Item24,


        [XmlEnumAttribute("25")]
        Item25,


        [XmlEnumAttribute("26")]
        Item26,


        [XmlEnumAttribute("27")]
        Item27,


        [XmlEnumAttribute("28")]
        Item28,


        [XmlEnumAttribute("29")]
        Item29,


        [XmlEnumAttribute("30")]
        Item30,


        [XmlEnumAttribute("31")]
        Item31,


        [XmlEnumAttribute("32")]
        Item32,
    }

    /// <summary>
    /// Clase que representa los descuentos generales, especifica la razón del descuento, el porcentaje a aplicar sobre el importe total bruto y el importe a descontar 
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class DiscountType
    {
        /// <summary>
        /// Razón o motivo del descuento
        /// </summary>
        private string discountReasonField;

        /// <summary>
        /// Porcentaje del descueto
        /// </summary>
        private string discountRateField;

        /// <summary>
        /// indica si se debe especificar el descuento en el archivo xml
        /// </summary>
        private bool discountRateFieldSpecified;

        /// <summary>
        /// importe a descontar
        /// </summary>
        private string discountAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string DiscountReason
        {
            get
            {
                return this.discountReasonField;
            }
            set
            {
                this.discountReasonField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string DiscountRate
        {
            get
            {
                return this.discountRateField;
            }
            set
            {
                this.discountRateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool DiscountRateSpecified
        {
            get
            {
                return this.discountRateFieldSpecified;
            }
            set
            {
                this.discountRateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string DiscountAmount
        {
            get
            {
                return this.discountAmountField;
            }
            set
            {
                this.discountAmountField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ChargeType
    {

        private string chargeReasonField;

        private string chargeRateField;

        private bool chargeRateFieldSpecified;

        private string chargeAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ChargeReason
        {
            get
            {
                return this.chargeReasonField;
            }
            set
            {
                this.chargeReasonField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ChargeRate
        {
            get
            {
                return this.chargeRateField;
            }
            set
            {
                this.chargeRateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool ChargeRateSpecified
        {
            get
            {
                return this.chargeRateFieldSpecified;
            }
            set
            {
                this.chargeRateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ChargeAmount
        {
            get
            {
                return this.chargeAmountField;
            }
            set
            {
                this.chargeAmountField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa los impuestos dentro de la Facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class TaxType
    {
        /// <summary>
        /// Código del impuesto
        /// </summary>
        private TaxTypeCodeType taxTypeCodeField;

        /// <summary>
        /// porcentaje de impuesto a aplicar
        /// </summary>
        private string taxRateField;

        /// <summary>
        /// Base Imponible sobre la que se aplican los impuestos
        /// </summary>
        private AmountType taxableBaseField;

        /// <summary>
        /// importe a aplicar
        /// </summary>
        private AmountType taxAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxTypeCodeType TaxTypeCode
        {
            get
            {
                return this.taxTypeCodeField;
            }
            set
            {
                this.taxTypeCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TaxRate
        {
            get
            {
                return this.taxRateField;
            }
            set
            {
                this.taxRateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TaxableBase
        {
            get
            {
                return this.taxableBaseField;
            }
            set
            {
                this.taxableBaseField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TaxAmount
        {
            get
            {
                return this.taxAmountField;
            }
            set
            {
                this.taxAmountField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los códigos de los tipos de impuesto
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum TaxTypeCodeType
    {


        [XmlEnumAttribute("01")]
        Item01,


        [XmlEnumAttribute("02")]
        Item02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,


        [XmlEnumAttribute("05")]
        Item05,


        [XmlEnumAttribute("06")]
        Item06,


        [XmlEnumAttribute("07")]
        Item07,


        [XmlEnumAttribute("08")]
        Item08,


        [XmlEnumAttribute("09")]
        Item09,


        [XmlEnumAttribute("10")]
        Item10,


        [XmlEnumAttribute("11")]
        Item11,


        [XmlEnumAttribute("12")]
        Item12,


        [XmlEnumAttribute("13")]
        Item13,


        [XmlEnumAttribute("14")]
        Item14,


        [XmlEnumAttribute("15")]
        Item15,


        [XmlEnumAttribute("16")]
        Item16,
    }

    /// <summary>
    /// Clase que representa los bloques de impportes en la Facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AmountType
    {
        /// <summary>
        /// El valor original aplicado
        /// </summary>
        private string totalAmountField;

        /// <summary>
        /// equivalencia en euros del valor original, cuando la moneda sea diferente a Euro
        /// </summary>
        private string equivalentInEurosField;

        /// <summary>
        /// indica si se debe especificar la equivalencia en euros, dentro del documento xml
        /// </summary>
        private bool equivalentInEurosFieldSpecified;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalAmount
        {
            get
            {
                return this.totalAmountField;
            }
            set
            {
                this.totalAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string EquivalentInEuros
        {
            get
            {
                return this.equivalentInEurosField;
            }
            set
            {
                this.equivalentInEurosField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool EquivalentInEurosSpecified
        {
            get
            {
                return this.equivalentInEurosFieldSpecified;
            }
            set
            {
                this.equivalentInEurosFieldSpecified = value;
            }
        }
    }

    /// <summary>
    /// Clase que heresa de la clase TaxOutputType, que permite especificar los impuestos reporcutivos por cada línea de detalle
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceLineTypeTax : TaxOutputType
    {
    }

    /// <summary>
    /// Clase que representa los impuestos repercutidos dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class TaxOutputType
    {
        /// <summary>
        /// Codigo del tipo de impuesto repercutido
        /// </summary>
        private TaxTypeCodeType taxTypeCodeField;

        /// <summary>
        /// Porcentaje de impuesto a aplicar sobre la base imponible
        /// </summary>
        private string taxRateField;

        /// <summary>
        /// Base imponible sobre la que se aplicara el porcentaje de impuestos
        /// </summary>
        private AmountType taxableBaseField;

        /// <summary>
        /// Importe del Impuesto aplicado
        /// </summary>
        private AmountType taxAmountField;


        private AmountType specialTaxableBaseField;

        private AmountType specialTaxAmountField;

        private string equivalenceSurchargeField;

        private bool equivalenceSurchargeFieldSpecified;

        private AmountType equivalenceSurchargeAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxTypeCodeType TaxTypeCode
        {
            get
            {
                return this.taxTypeCodeField;
            }
            set
            {
                this.taxTypeCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TaxRate
        {
            get
            {
                return this.taxRateField;
            }
            set
            {
                this.taxRateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TaxableBase
        {
            get
            {
                return this.taxableBaseField;
            }
            set
            {
                this.taxableBaseField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TaxAmount
        {
            get
            {
                return this.taxAmountField;
            }
            set
            {
                this.taxAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType SpecialTaxableBase
        {
            get
            {
                return this.specialTaxableBaseField;
            }
            set
            {
                this.specialTaxableBaseField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType SpecialTaxAmount
        {
            get
            {
                return this.specialTaxAmountField;
            }
            set
            {
                this.specialTaxAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string EquivalenceSurcharge
        {
            get
            {
                return this.equivalenceSurchargeField;
            }
            set
            {
                this.equivalenceSurchargeField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool EquivalenceSurchargeSpecified
        {
            get
            {
                return this.equivalenceSurchargeFieldSpecified;
            }
            set
            {
                this.equivalenceSurchargeFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType EquivalenceSurchargeAmount
        {
            get
            {
                return this.equivalenceSurchargeAmountField;
            }
            set
            {
                this.equivalenceSurchargeAmountField = value;
            }
        }
    }

    /// <summary>
    ///Clase que representa el Período natural en el que se produjeron los efectos fiscales de la factura a rectificar; y, por lo tanto, se
    ///tributó, y que ahora, es objeto de rectificación
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class PeriodDates
    {
        /// <summary>
        /// Fecha de inicio.
        /// </summary>
        private DateTime startDateField;

        /// <summary>
        /// Fecha de Finalizacion
        /// </summary>
        private DateTime endDateField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime StartDate
        {
            get
            {
                return this.startDateField;
            }
            set
            {
                this.startDateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime EndDate
        {
            get
            {
                return this.endDateField;
            }
            set
            {
                this.endDateField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AmountsWithheldType
    {

        private string withholdingReasonField;

        private string withholdingRateField;

        private bool withholdingRateFieldSpecified;

        private string withholdingAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string WithholdingReason
        {
            get
            {
                return this.withholdingReasonField;
            }
            set
            {
                this.withholdingReasonField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string WithholdingRate
        {
            get
            {
                return this.withholdingRateField;
            }
            set
            {
                this.withholdingRateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool WithholdingRateSpecified
        {
            get
            {
                return this.withholdingRateFieldSpecified;
            }
            set
            {
                this.withholdingRateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string WithholdingAmount
        {
            get
            {
                return this.withholdingAmountField;
            }
            set
            {
                this.withholdingAmountField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ReimbursableExpensesType
    {

        private TaxIdentificationType reimbursableExpensesSellerPartyField;

        private TaxIdentificationType reimbursableExpensesBuyerPartyField;

        private DateTime issueDateField;

        private bool issueDateFieldSpecified;

        private string invoiceNumberField;

        private string invoiceSeriesCodeField;

        private string reimbursableExpensesAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxIdentificationType ReimbursableExpensesSellerParty
        {
            get
            {
                return this.reimbursableExpensesSellerPartyField;
            }
            set
            {
                this.reimbursableExpensesSellerPartyField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxIdentificationType ReimbursableExpensesBuyerParty
        {
            get
            {
                return this.reimbursableExpensesBuyerPartyField;
            }
            set
            {
                this.reimbursableExpensesBuyerPartyField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime IssueDate
        {
            get
            {
                return this.issueDateField;
            }
            set
            {
                this.issueDateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool IssueDateSpecified
        {
            get
            {
                return this.issueDateFieldSpecified;
            }
            set
            {
                this.issueDateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceNumber
        {
            get
            {
                return this.invoiceNumberField;
            }
            set
            {
                this.invoiceNumberField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceSeriesCode
        {
            get
            {
                return this.invoiceSeriesCodeField;
            }
            set
            {
                this.invoiceSeriesCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ReimbursableExpensesAmount
        {
            get
            {
                return this.reimbursableExpensesAmountField;
            }
            set
            {
                this.reimbursableExpensesAmountField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class PaymentOnAccountType
    {

        private DateTime paymentOnAccountDateField;

        private string paymentOnAccountAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime PaymentOnAccountDate
        {
            get
            {
                return this.paymentOnAccountDateField;
            }
            set
            {
                this.paymentOnAccountDateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PaymentOnAccountAmount
        {
            get
            {
                return this.paymentOnAccountAmountField;
            }
            set
            {
                this.paymentOnAccountAmountField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class SubsidyType
    {

        private string subsidyDescriptionField;

        private string subsidyRateField;

        private bool subsidyRateFieldSpecified;

        private string subsidyAmountField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string SubsidyDescription
        {
            get
            {
                return this.subsidyDescriptionField;
            }
            set
            {
                this.subsidyDescriptionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string SubsidyRate
        {
            get
            {
                return this.subsidyRateField;
            }
            set
            {
                this.subsidyRateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool SubsidyRateSpecified
        {
            get
            {
                return this.subsidyRateFieldSpecified;
            }
            set
            {
                this.subsidyRateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string SubsidyAmount
        {
            get
            {
                return this.subsidyAmountField;
            }
            set
            {
                this.subsidyAmountField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa el bloque de totales dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceTotalsType
    {
        /// <summary>
        /// importe  total bruto
        /// </summary>
        private string totalGrossAmountField;

        /// <summary>
        ///Lista de descuentos generales generales aplicables al importe total bruto
        /// </summary>
        private List<DiscountType> generalDiscountsField;


        private List<ChargeType> generalSurchargesField;

        /// <summary>
        /// Total de los descuentos generales
        /// </summary>
        private string totalGeneralDiscountsField;

        /// <summary>
        /// Indica si se debe especificar el total de los descuentos generales
        /// </summary>
        private bool totalGeneralDiscountsFieldSpecified;

        private string totalGeneralSurchargesField;

        private bool totalGeneralSurchargesFieldSpecified;

        /// <summary>
        /// Base imponible sobre la que se aplcian los impuestos = totalGrossAmountField-totalGeneralDiscountsField
        /// </summary>
        private string totalGrossAmountBeforeTaxesField;

        /// <summary>
        /// total de impuestos repercutidos aplicables a totalGrossAmountBeforeTaxesField
        /// </summary>
        private string totalTaxOutputsField;

        /// <summary>
        /// total de impuestos retenidos aplicables a totalGrossAmountBeforeTaxesField
        /// </summary>
        private string totalTaxesWithheldField;

        /// <summary>
        /// importe total de la factura = (totalGrossAmountBeforeTaxesField + totalTaxOutputsField - totalTaxesWithheldField)
        /// </summary>
        private string invoiceTotalField;

        private List<SubsidyType> subsidiesField;

        private List<PaymentOnAccountType> paymentsOnAccountField;

        private List<ReimbursableExpensesType> reimbursableExpensesField;

        private string totalFinancialExpensesField;

        private bool totalFinancialExpensesFieldSpecified;

        /// <summary>
        /// en nuestra factura siempre sera igual a invoiceTotalField
        /// </summary>
        private string totalOutstandingAmountField;

        private string totalPaymentsOnAccountField;

        private bool totalPaymentsOnAccountFieldSpecified;

        private AmountsWithheldType amountsWithheldField;

        /// <summary>
        /// en nuestra factura siempre sera igual a invoiceTotalField
        /// </summary>
        private string totalExecutableAmountField;

        private string totalReimbursableExpensesField;

        private bool totalReimbursableExpensesFieldSpecified;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalGrossAmount
        {
            get
            {
                return this.totalGrossAmountField;
            }
            set
            {
                this.totalGrossAmountField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Discount", Form = XmlSchemaForm.Unqualified, IsNullable = true)]
        public List<DiscountType> GeneralDiscounts
        {
            get
            {
                return this.generalDiscountsField;
            }
            set
            {
                this.generalDiscountsField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Charge", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<ChargeType> GeneralSurcharges
        {
            get
            {
                return this.generalSurchargesField;
            }
            set
            {
                this.generalSurchargesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalGeneralDiscounts
        {
            get
            {
                return this.totalGeneralDiscountsField;
            }
            set
            {
                this.totalGeneralDiscountsField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TotalGeneralDiscountsSpecified
        {
            get
            {
                return this.totalGeneralDiscountsFieldSpecified;
            }
            set
            {
                this.totalGeneralDiscountsFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalGeneralSurcharges
        {
            get
            {
                return this.totalGeneralSurchargesField;
            }
            set
            {
                this.totalGeneralSurchargesField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TotalGeneralSurchargesSpecified
        {
            get
            {
                return this.totalGeneralSurchargesFieldSpecified;
            }
            set
            {
                this.totalGeneralSurchargesFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalGrossAmountBeforeTaxes
        {
            get
            {
                return this.totalGrossAmountBeforeTaxesField;
            }
            set
            {
                this.totalGrossAmountBeforeTaxesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalTaxOutputs
        {
            get
            {
                return this.totalTaxOutputsField;
            }
            set
            {
                this.totalTaxOutputsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalTaxesWithheld
        {
            get
            {
                return this.totalTaxesWithheldField;
            }
            set
            {
                this.totalTaxesWithheldField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceTotal
        {
            get
            {
                return this.invoiceTotalField;
            }
            set
            {
                this.invoiceTotalField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Subsidy", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<SubsidyType> Subsidies
        {
            get
            {
                return this.subsidiesField;
            }
            set
            {
                this.subsidiesField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("PaymentOnAccount", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<PaymentOnAccountType> PaymentsOnAccount
        {
            get
            {
                return this.paymentsOnAccountField;
            }
            set
            {
                this.paymentsOnAccountField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("ReimbursableExpenses", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<ReimbursableExpensesType> ReimbursableExpenses
        {
            get
            {
                return this.reimbursableExpensesField;
            }
            set
            {
                this.reimbursableExpensesField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalFinancialExpenses
        {
            get
            {
                return this.totalFinancialExpensesField;
            }
            set
            {
                this.totalFinancialExpensesField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TotalFinancialExpensesSpecified
        {
            get
            {
                return this.totalFinancialExpensesFieldSpecified;
            }
            set
            {
                this.totalFinancialExpensesFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalOutstandingAmount
        {
            get
            {
                return this.totalOutstandingAmountField;
            }
            set
            {
                this.totalOutstandingAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalPaymentsOnAccount
        {
            get
            {
                return this.totalPaymentsOnAccountField;
            }
            set
            {
                this.totalPaymentsOnAccountField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TotalPaymentsOnAccountSpecified
        {
            get
            {
                return this.totalPaymentsOnAccountFieldSpecified;
            }
            set
            {
                this.totalPaymentsOnAccountFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountsWithheldType AmountsWithheld
        {
            get
            {
                return this.amountsWithheldField;
            }
            set
            {
                this.amountsWithheldField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalExecutableAmount
        {
            get
            {
                return this.totalExecutableAmountField;
            }
            set
            {
                this.totalExecutableAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TotalReimbursableExpenses
        {
            get
            {
                return this.totalReimbursableExpensesField;
            }
            set
            {
                this.totalReimbursableExpensesField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool TotalReimbursableExpensesSpecified
        {
            get
            {
                return this.totalReimbursableExpensesFieldSpecified;
            }
            set
            {
                this.totalReimbursableExpensesFieldSpecified = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ExchangeRateDetailsType
    {

        private string exchangeRateField;

        private DateTime exchangeRateDateField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ExchangeRate
        {
            get
            {
                return this.exchangeRateField;
            }
            set
            {
                this.exchangeRateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime ExchangeRateDate
        {
            get
            {
                return this.exchangeRateDateField;
            }
            set
            {
                this.exchangeRateDateField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class PlaceOfIssueType
    {

        private string postCodeField;

        private string placeOfIssueDescriptionField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PostCode
        {
            get
            {
                return this.postCodeField;
            }
            set
            {
                this.postCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PlaceOfIssueDescription
        {
            get
            {
                return this.placeOfIssueDescriptionField;
            }
            set
            {
                this.placeOfIssueDescriptionField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa al bloque de datos de emision de la factura, dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceIssueDataType
    {
        /// <summary>
        /// Fecha de emision
        /// </summary>
        private DateTime issueDateField;

        /// <summary>
        /// Fecha de operacion, para las transacciones
        /// </summary>
        private DateTime operationDateField;

        /// <summary>
        /// se especifica (true) solo cuando la operacion de emision es diferente a la fecha de emision
        /// </summary>
        private bool operationDateFieldSpecified;

        /// <summary>
        /// Lugar de emision de la factura
        /// </summary>
        private PlaceOfIssueType placeOfIssueField;

        /// <summary>
        /// Información sobre el periodo de prestación de un servicio.
        /// </summary>
        private PeriodDates invoicingPeriodField;

        /// <summary>
        /// codigo de la moneda en el que se realiza la factura, para este caso EUR
        /// </summary>
        private CurrencyCodeType invoiceCurrencyCodeField;

        /// <summary>
        /// tipo de cambio de moneda extrangera a Euro
        /// </summary>
        private ExchangeRateDetailsType exchangeRateDetailsField;

        private CurrencyCodeType taxCurrencyCodeField;

        /// <summary>
        /// Lenguaje en el que se se emite la factura, por defecto Inglés
        /// </summary>
        private LanguageCodeType languageNameField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime IssueDate
        {
            get
            {
                return this.issueDateField;
            }
            set
            {
                this.issueDateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime OperationDate
        {
            get
            {
                return this.operationDateField;
            }
            set
            {
                this.operationDateField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool OperationDateSpecified
        {
            get
            {
                return this.operationDateFieldSpecified;
            }
            set
            {
                this.operationDateFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PlaceOfIssueType PlaceOfIssue
        {
            get
            {
                return this.placeOfIssueField;
            }
            set
            {
                this.placeOfIssueField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PeriodDates InvoicingPeriod
        {
            get
            {
                return this.invoicingPeriodField;
            }
            set
            {
                this.invoicingPeriodField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CurrencyCodeType InvoiceCurrencyCode
        {
            get
            {
                return this.invoiceCurrencyCodeField;
            }
            set
            {
                this.invoiceCurrencyCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ExchangeRateDetailsType ExchangeRateDetails
        {
            get
            {
                return this.exchangeRateDetailsField;
            }
            set
            {
                this.exchangeRateDetailsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CurrencyCodeType TaxCurrencyCode
        {
            get
            {
                return this.taxCurrencyCodeField;
            }
            set
            {
                this.taxCurrencyCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public LanguageCodeType LanguageName
        {
            get
            {
                return this.languageNameField;
            }
            set
            {
                this.languageNameField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los códigos de los tipos de moneda contemplados dentro del esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum CurrencyCodeType
    {


        AFN,


        ALL,


        AMD,


        ANG,


        AOA,


        ARS,


        AUD,


        AWG,


        AZN,


        BAD,


        BBD,


        BDT,


        BGN,


        BHD,


        BIF,


        BMD,


        BND,


        BOB,


        BRL,


        BRR,


        BSD,


        BWP,


        BYR,


        BZD,


        CAD,


        CDF,


        CDP,


        CHF,


        CLP,


        CNY,


        COP,


        CRC,


        CUP,


        CVE,


        CZK,


        DJF,


        DKK,


        DOP,


        DRP,


        DZD,


        EEK,


        EGP,


        ESP,


        ETB,


        EUR,


        FJD,


        FKP,


        GBP,


        GEK,


        GHC,


        GIP,


        GMD,


        GNF,


        GTQ,


        GWP,


        GYD,


        HKD,


        HNL,


        HRK,


        HTG,


        HUF,


        IDR,


        ILS,


        INR,


        IQD,


        IRR,


        ISK,


        JMD,


        JOD,


        JPY,


        KES,


        KGS,


        KHR,


        KMF,


        KPW,


        KRW,


        KWD,


        KYD,


        KZT,


        LAK,


        LBP,


        LKR,


        LRD,


        LSL,


        LTL,


        LVL,


        LYD,


        MAD,


        MDL,


        MGF,


        MNC,


        MNT,


        MOP,


        MRO,


        MUR,


        MVR,


        MWK,


        MXN,


        MYR,


        MZM,


        NGN,


        NIC,


        NIO,


        NIS,


        NOK,


        NPR,


        NZD,


        OMR,


        PAB,


        PEI,


        PEN,


        PES,


        PGK,


        PHP,


        PKR,


        PLN,


        PYG,


        QAR,


        RMB,


        RON,


        RUB,


        RWF,


        SAR,


        SBD,


        SCR,


        SDP,


        SEK,


        SGD,


        SHP,


        SKK,


        SLL,


        SOL,


        SOS,


        SRD,


        STD,


        SVC,


        SYP,


        SZL,


        THB,


        TJS,


        TMM,


        TND,


        TOP,


        TPE,


        TRY,


        TTD,


        TWD,


        TZS,


        UAH,


        UGS,


        USD,


        UYP,


        UYU,


        VEF,


        VND,


        VUV,


        WST,


        XAF,


        XCD,


        XOF,


        YER,


        ZAR,


        ZMK,


        ZWD,
    }

    /// <summary>
    /// Enumerado que brinda los códigos de los idiomas que contempla el esque de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum LanguageCodeType
    {


        ar,


        be,


        bg,


        ca,


        cs,


        da,


        de,


        el,


        en,


        es,


        et,


        eu,


        fi,


        fr,


        ga,


        gl,


        hr,


        hu,


        @is,


        it,


        lv,


        lt,


        mk,


        mt,


        nl,


        no,


        pl,


        pt,


        ro,


        ru,


        sk,


        sl,


        sq,


        sr,


        sv,


        tr,


        uk,
    }

    /// <summary>
    /// Clase que representa los datos necesarios para generar una facturae rectificativa
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class CorrectiveType
    {
        /// <summary>
        /// número ó secuencia de la nueva factura generada
        /// </summary>
        private string invoiceNumberField;

        /// <summary>
        /// serie de la nueva factura
        /// </summary>
        private string invoiceSeriesCodeField;

        /// <summary>
        /// código del motivo de la rectificacion 
        /// </summary>
        private ReasonCodeType reasonCodeField;

        /// <summary>
        /// Descripcion del motivo de la rectificación
        /// </summary>
        private string reasonDescriptionField;

        private PeriodDates taxPeriodField;

        /// <summary>
        /// Código del método utilizado para la rectificación dela factura
        /// </summary>
        private CorrectionMethodType correctionMethodField;

        /// <summary>
        /// Descripción del método utilizado para la rectificación de la factura
        /// </summary>
        private string correctionMethodDescriptionField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceNumber
        {
            get
            {
                return this.invoiceNumberField;
            }
            set
            {
                this.invoiceNumberField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceSeriesCode
        {
            get
            {
                return this.invoiceSeriesCodeField;
            }
            set
            {
                this.invoiceSeriesCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ReasonCodeType ReasonCode
        {
            get
            {
                return this.reasonCodeField;
            }
            set
            {
                this.reasonCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ReasonDescription
        {
            get
            {
                return this.reasonDescriptionField;
            }
            set
            {
                this.reasonDescriptionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PeriodDates TaxPeriod
        {
            get
            {
                return this.taxPeriodField;
            }
            set
            {
                this.taxPeriodField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CorrectionMethodType CorrectionMethod
        {
            get
            {
                return this.correctionMethodField;
            }
            set
            {
                this.correctionMethodField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string CorrectionMethodDescription
        {
            get
            {
                return this.correctionMethodDescriptionField;
            }
            set
            {
                this.correctionMethodDescriptionField = value;
            }
        }
    }

    /// <summary>
    /// Enumerado que brinda los códigos para el motivo de retificación contemplados en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum ReasonCodeType
    {


        [XmlEnumAttribute("01")]
        Item01,


        [XmlEnumAttribute("02")]
        Item02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,


        [XmlEnumAttribute("05")]
        Item05,


        [XmlEnumAttribute("06")]
        Item06,


        [XmlEnumAttribute("07")]
        Item07,


        [XmlEnumAttribute("08")]
        Item08,


        [XmlEnumAttribute("09")]
        Item09,


        [XmlEnumAttribute("10")]
        Item10,


        [XmlEnumAttribute("11")]
        Item11,


        [XmlEnumAttribute("12")]
        Item12,


        [XmlEnumAttribute("13")]
        Item13,


        [XmlEnumAttribute("14")]
        Item14,


        [XmlEnumAttribute("15")]
        Item15,


        [XmlEnumAttribute("16")]
        Item16,


        [XmlEnumAttribute("80")]
        Item80,


        [XmlEnumAttribute("81")]
        Item81,


        [XmlEnumAttribute("82")]
        Item82,


        [XmlEnumAttribute("83")]
        Item83,


        [XmlEnumAttribute("84")]
        Item84,


        [XmlEnumAttribute("85")]
        Item85,
    }

    /// <summary>
    /// Enumerado que brinda la descripción del motivo de rectificación contemplados en el esquema de facturae
    /// Deben ir vínculados a cada uno de los elementos del enumerado ReasonCodeType
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum ReasonDescriptionType
    {


        [XmlEnumAttribute("Número de la factura")]
        Númerodelafactura,


        [XmlEnumAttribute("Serie de la factura")]
        Seriedelafactura,


        [XmlEnumAttribute("Fecha expedición")]
        Fechaexpedición,


        [XmlEnumAttribute("Nombre y apellidos/Razón Social-Emisor")]
        NombreyapellidosRazónSocialEmisor,


        [XmlEnumAttribute("Nombre y apellidos/Razón Social-Receptor")]
        NombreyapellidosRazónSocialReceptor,


        [XmlEnumAttribute("Identificación fiscal Emisor/obligado")]
        IdentificaciónfiscalEmisorobligado,


        [XmlEnumAttribute("Identificación fiscal Receptor")]
        IdentificaciónfiscalReceptor,


        [XmlEnumAttribute("Domicilio Emisor/Obligado")]
        DomicilioEmisorObligado,


        [XmlEnumAttribute("Domicilio Receptor")]
        DomicilioReceptor,


        [XmlEnumAttribute("Detalle Operación")]
        DetalleOperación,


        [XmlEnumAttribute("Porcentaje impositivo a aplicar")]
        Porcentajeimpositivoaaplicar,


        [XmlEnumAttribute("Cuota tributaria a aplicar")]
        Cuotatributariaaaplicar,


        [XmlEnumAttribute("Fecha/Periodo a aplicar")]
        FechaPeriodoaaplicar,


        [XmlEnumAttribute("Clase de factura")]
        Clasedefactura,


        [XmlEnumAttribute("Literales legales")]
        Literaleslegales,


        [XmlEnumAttribute("Base imponible")]
        Baseimponible,


        [XmlEnumAttribute("Cálculo de cuotas repercutidas")]
        Cálculodecuotasrepercutidas,


        [XmlEnumAttribute("Cálculo de cuotas retenidas")]
        Cálculodecuotasretenidas,


        [XmlEnumAttribute("Base imponible modificada por devolución de envases / embalajes")]
        Baseimponiblemodificadapordevolucióndeenvasesembalajes,


        [XmlEnumAttribute("Base imponible modificada por descuentos y bonificaciones")]
        Baseimponiblemodificadapordescuentosybonificaciones,


        [XmlEnumAttribute("Base imponible modificada por resolución firme, judicial o administrativa")]
        Baseimponiblemodificadaporresoluciónfirmejudicialoadministrativa,


        [XmlEnumAttribute("Base imponible modificada cuotas repercutidas no satisfechas. Auto de declaración" +
            " de concurso")]
        BaseimponiblemodificadacuotasrepercutidasnosatisfechasAutodedeclaracióndeconcurso,
    }

    /// <summary>
    /// Enumerado que brinda los códigos para los métodos de correccion contemplados en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum CorrectionMethodType
    {


        [XmlEnumAttribute("01")]
        Item01 = 01,


        [XmlEnumAttribute("02")]
        Item02 = 02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,
    }

    /// <summary>
    /// Enumerado que brinda la descripción para los métodos de rectificación contemplados en el esquema de facturae
    /// Deben ir vínculados a cada uno de los elementos del enumerado CorrectionMethodType
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum CorrectionMethodDescriptionType
    {


        [XmlEnumAttribute("Rectificación íntegra")]
        Rectificacióníntegra,


        [XmlEnumAttribute("Rectificación por diferencias")]
        Rectificaciónpordiferencias,


        [XmlEnumAttribute("Rectificación por descuento por volumen de operaciones durante un periodo")]
        Rectificaciónpordescuentoporvolumendeoperacionesduranteunperiodo,


        [XmlEnumAttribute("Autorizadas por la Agencia Tributaria")]
        AutorizadasporlaAgenciaTributaria,
    }


    /// <summary>
    /// Clase que representa el bloque de datos correspondientes al encabezado de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceHeaderType
    {
        /// <summary>
        /// número o secuencia de la factura a generar
        /// </summary>
        private string invoiceNumberField;

        /// <summary>
        /// serie de la factura a generar
        /// </summary>
        private string invoiceSeriesCodeField;

        /// <summary>
        /// tipo de la factura a generar, para este caso aplican los tipos de FC ( factura completa) y AF (autofactura)
        /// </summary>
        private InvoiceDocumentTypeType invoiceDocumentTypeField;

        /// <summary>
        /// Clase de la factura a generar; Original, Rectificativa, Copia de Original o Copia de Rectificativa
        /// </summary>
        private InvoiceClassType invoiceClassField;

        /// <summary>
        /// Representa el bloque de datos correspondientes a la factura rectificativa, se completa solo en el caso de que la clase
        /// de la factura a generar sea OR, ó CR
        /// </summary>
        private CorrectiveType correctiveField;




        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceNumber
        {
            get
            {
                return this.invoiceNumberField;
            }
            set
            {
                this.invoiceNumberField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string InvoiceSeriesCode
        {
            get
            {
                return this.invoiceSeriesCodeField;
            }
            set
            {
                this.invoiceSeriesCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceDocumentTypeType InvoiceDocumentType
        {
            get
            {
                return this.invoiceDocumentTypeField;
            }
            set
            {
                this.invoiceDocumentTypeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceClassType InvoiceClass
        {
            get
            {
                return this.invoiceClassField;
            }
            set
            {
                this.invoiceClassField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CorrectiveType Corrective
        {
            get
            {
                return this.correctiveField;
            }
            set
            {
                this.correctiveField = value;
            }
        }
    }


    /// <summary>
    /// Enumerado que brinda los tipos de documento contemplados en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum InvoiceDocumentTypeType
    {

        /// <summary>
        /// Factura Completa
        /// </summary>
        FC,

        /// <summary>
        /// Factura Abreviada
        /// </summary>
        FA,

        /// <summary>
        /// Autofactura
        /// </summary>
        AF,
    }

    /// <summary>
    /// Enumerado que brinda los Clases de factura a generar contempladas en el esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum InvoiceClassType
    {

        /// <summary>
        /// Original
        /// </summary>
        OO,

        /// <summary>
        /// Original Rectificativa
        /// </summary>
        OR,


        OC,

        /// <summary>
        /// Copia de Original
        /// </summary>
        CO,

        /// <summary>
        /// Copia de Rectificativa
        /// </summary>
        CR,


        CC,
    }

    /// <summary>
    /// Clase que representa el bloque de la factura dentro del esquema de facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class InvoiceType
    {
        /// <summary>
        /// Encabezado de la factura
        /// </summary>
        private InvoiceHeaderType invoiceHeaderField;

        /// <summary>
        /// Datos de emisión de la factura
        /// </summary>
        private InvoiceIssueDataType invoiceIssueDataField;

        /// <summary>
        /// Listado de impuestos repercutidos de la factura
        /// </summary>
        private List<TaxOutputType> taxesOutputsField;

        /// <summary>
        /// Listado de los impuestos retenidos de la facturae
        /// </summary>
        private List<TaxType> taxesWithheldField;

        /// <summary>
        /// Bloque de totales de la factura
        /// </summary>
        private InvoiceTotalsType invoiceTotalsField;

        /// <summary>
        /// Listado de detalles ó itemes de la factura
        /// </summary>
        private List<InvoiceLineType> itemsField;

        /// <summary>
        /// Listado de detalles de pago para la factura
        /// </summary>
        private List<InstallmentType> paymentDetailsField;

        private List<string> legalLiteralsField;

        /// <summary>
        /// Informacion adicional de la factura
        /// </summary>
        private AdditionalDataType additionalDataField;

        public InvoiceType()
        {
            invoiceHeaderField = new InvoiceHeaderType();
            itemsField = new List<InvoiceLineType>();
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceHeaderType InvoiceHeader
        {
            get
            {
                return this.invoiceHeaderField;
            }
            set
            {
                this.invoiceHeaderField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceIssueDataType InvoiceIssueData
        {
            get
            {
                return this.invoiceIssueDataField;
            }
            set
            {
                this.invoiceIssueDataField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Tax", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<TaxOutputType> TaxesOutputs
        {
            get
            {
                return this.taxesOutputsField;
            }
            set
            {
                this.taxesOutputsField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Tax", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<TaxType> TaxesWithheld
        {
            get
            {
                return this.taxesWithheldField;
            }
            set
            {
                this.taxesWithheldField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public InvoiceTotalsType InvoiceTotals
        {
            get
            {
                return this.invoiceTotalsField;
            }
            set
            {
                this.invoiceTotalsField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("InvoiceLine", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<InvoiceLineType> Items
        {
            get
            {
                return this.itemsField;
            }
            set
            {
                this.itemsField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("Installment", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<InstallmentType> PaymentDetails
        {
            get
            {
                return this.paymentDetailsField;
            }
            set
            {
                this.paymentDetailsField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("LegalReference", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<string> LegalLiterals
        {
            get
            {
                return this.legalLiteralsField;
            }
            set
            {
                this.legalLiteralsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AdditionalDataType AdditionalData
        {
            get
            {
                return this.additionalDataField;
            }
            set
            {
                this.additionalDataField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AdministrativeCentreType
    {

        private string centreCodeField;

        private RoleTypeCodeType roleTypeCodeField;

        private bool roleTypeCodeFieldSpecified;

        private string nameField;

        private string firstSurnameField;

        private string secondSurnameField;

        private object itemField;

        private ContactDetailsType contactDetailsField;

        private string physicalGLNField;

        private string logicalOperationalPointField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string CentreCode
        {
            get
            {
                return this.centreCodeField;
            }
            set
            {
                this.centreCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public RoleTypeCodeType RoleTypeCode
        {
            get
            {
                return this.roleTypeCodeField;
            }
            set
            {
                this.roleTypeCodeField = value;
            }
        }


        [XmlIgnoreAttribute()]
        public bool RoleTypeCodeSpecified
        {
            get
            {
                return this.roleTypeCodeFieldSpecified;
            }
            set
            {
                this.roleTypeCodeFieldSpecified = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Name
        {
            get
            {
                return this.nameField;
            }
            set
            {
                this.nameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string FirstSurname
        {
            get
            {
                return this.firstSurnameField;
            }
            set
            {
                this.firstSurnameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string SecondSurname
        {
            get
            {
                return this.secondSurnameField;
            }
            set
            {
                this.secondSurnameField = value;
            }
        }


        [XmlElementAttribute("AddressInSpain", typeof(AddressType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("OverseasAddress", typeof(OverseasAddressType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ContactDetailsType ContactDetails
        {
            get
            {
                return this.contactDetailsField;
            }
            set
            {
                this.contactDetailsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PhysicalGLN
        {
            get
            {
                return this.physicalGLNField;
            }
            set
            {
                this.physicalGLNField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string LogicalOperationalPoint
        {
            get
            {
                return this.logicalOperationalPointField;
            }
            set
            {
                this.logicalOperationalPointField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public enum RoleTypeCodeType
    {


        [XmlEnumAttribute("01")]
        Item01,


        [XmlEnumAttribute("02")]
        Item02,


        [XmlEnumAttribute("03")]
        Item03,


        [XmlEnumAttribute("04")]
        Item04,


        [XmlEnumAttribute("05")]
        Item05,
    }

    /// <summary>
    /// Clase que representa el bloque de datos de contacto para las partes(IssuerParty, SellerParty, ThirdParty) que intervienen en la factura
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class ContactDetailsType
    {
        /// <summary>
        /// Número de telefono
        /// </summary>
        private string telephoneField;

        /// <summary>
        /// Número de fax
        /// </summary>
        private string teleFaxField;

        /// <summary>
        /// Direccion del sitio web
        /// </summary>
        private string webAddressField;

        /// <summary>
        /// Email
        /// </summary>
        private string electronicMailField;

        /// <summary>
        /// persona de contacto
        /// </summary>
        private string contactPersonsField;

        private string cnoCnaeField;

        private string iNETownCodeField;

        /// <summary>
        /// otros datos de contacto
        /// </summary>
        private string additionalContactDetailsField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Telephone
        {
            get
            {
                return this.telephoneField;
            }
            set
            {
                this.telephoneField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TeleFax
        {
            get
            {
                return this.teleFaxField;
            }
            set
            {
                this.teleFaxField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string WebAddress
        {
            get
            {
                return this.webAddressField;
            }
            set
            {
                this.webAddressField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ElectronicMail
        {
            get
            {
                return this.electronicMailField;
            }
            set
            {
                this.electronicMailField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string ContactPersons
        {
            get
            {
                return this.contactPersonsField;
            }
            set
            {
                this.contactPersonsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string CnoCnae
        {
            get
            {
                return this.cnoCnaeField;
            }
            set
            {
                this.cnoCnaeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string INETownCode
        {
            get
            {
                return this.iNETownCodeField;
            }
            set
            {
                this.iNETownCodeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AdditionalContactDetails
        {
            get
            {
                return this.additionalContactDetailsField;
            }
            set
            {
                this.additionalContactDetailsField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa el bloque de datos correspondiente a la informcion sobre el SellerParty y el BuyerParty dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class BusinessType
    {
        /// <summary>
        /// Especifica los datos de identificacion de la parte
        /// </summary>
        private TaxIdentificationType taxIdentificationField;

        private string partyIdentificationField;

        private List<AdministrativeCentreType> administrativeCentresField;

        /// <summary>
        /// Variable object para asignar el tipo de persona que puede ser IndividualType o LegalEtityType
        /// </summary>
        private object itemField;

        public BusinessType()
        {
            taxIdentificationField = new TaxIdentificationType();
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxIdentificationType TaxIdentification
        {
            get
            {
                return this.taxIdentificationField;
            }
            set
            {
                this.taxIdentificationField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PartyIdentification
        {
            get
            {
                return this.partyIdentificationField;
            }
            set
            {
                this.partyIdentificationField = value;
            }
        }


        [XmlArrayAttribute(Form = XmlSchemaForm.Unqualified)]
        [XmlArrayItemAttribute("AdministrativeCentre", Form = XmlSchemaForm.Unqualified, IsNullable = false)]
        public List<AdministrativeCentreType> AdministrativeCentres
        {
            get
            {
                return this.administrativeCentresField;
            }
            set
            {
                this.administrativeCentresField = value;
            }
        }


        [XmlElementAttribute("Individual", typeof(IndividualType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("LegalEntity", typeof(LegalEntityType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }
    }


    /// <summary>
    /// Clase que representa los datos referentes al tipo de personsa Física, se utilzia cuando el codigo del campo personType = F
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class IndividualType
    {
        /// <summary>
        /// nombre de la persona
        /// </summary>
        private string nameField;

        /// <summary>
        /// primer apellido de la persona
        /// </summary>
        private string firstSurnameField;

        /// <summary>
        /// segundo apellido de la persona
        /// </summary>
        private string secondSurnameField;

        /// <summary>
        /// variable de tipo object que representa la dirección de la parte, puedo ser del tipo AddressInSpain ó OverSeasAddress
        /// </summary>
        private object itemField;

        /// <summary>
        /// Datos de contacto de la persona
        /// </summary>
        private ContactDetailsType contactDetailsField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Name
        {
            get
            {
                return this.nameField;
            }
            set
            {
                this.nameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string FirstSurname
        {
            get
            {
                return this.firstSurnameField;
            }
            set
            {
                this.firstSurnameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string SecondSurname
        {
            get
            {
                return this.secondSurnameField;
            }
            set
            {
                this.secondSurnameField = value;
            }
        }


        [XmlElementAttribute("AddressInSpain", typeof(AddressType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("OverseasAddress", typeof(OverseasAddressType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ContactDetailsType ContactDetails
        {
            get
            {
                return this.contactDetailsField;
            }
            set
            {
                this.contactDetailsField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa los datos referentes al tipo de personsa Jurídica, se utilzia cuando el codigo del campo personType = J
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class LegalEntityType
    {


        /// <summary>
        /// razon social
        /// </summary>
        private string corporateNameField = "";

        /// <summary>
        /// nombre comercial *opcional*
        /// </summary>
        private string tradeNameField;

        private RegistrationDataType registrationDataField;

        /// <summary>
        /// variable de tipo object que representa la dirección de la parte, puedo ser del tipo AddressInSpain ó OverSeasAddress
        /// </summary>
        private object itemField;

        /// <summary>
        /// datos de contacto de la empresa
        /// </summary>
        private ContactDetailsType contactDetailsField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string CorporateName
        {
            get
            {
                return this.corporateNameField;
            }
            set
            {
                this.corporateNameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string TradeName
        {
            get
            {
                return this.tradeNameField;
            }
            set
            {
                this.tradeNameField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public RegistrationDataType RegistrationData
        {
            get
            {
                return this.registrationDataField;
            }
            set
            {
                this.registrationDataField = value;
            }
        }


        [XmlElementAttribute("AddressInSpain", typeof(AddressType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("OverseasAddress", typeof(OverseasAddressType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public ContactDetailsType ContactDetails
        {
            get
            {
                return this.contactDetailsField;
            }
            set
            {
                this.contactDetailsField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class RegistrationDataType
    {

        private string bookField;

        private string registerOfCompaniesLocationField;

        private string sheetField;

        private string folioField;

        private string sectionField;

        private string volumeField;

        private string additionalRegistrationDataField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Book
        {
            get
            {
                return this.bookField;
            }
            set
            {
                this.bookField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string RegisterOfCompaniesLocation
        {
            get
            {
                return this.registerOfCompaniesLocationField;
            }
            set
            {
                this.registerOfCompaniesLocationField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Sheet
        {
            get
            {
                return this.sheetField;
            }
            set
            {
                this.sheetField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Folio
        {
            get
            {
                return this.folioField;
            }
            set
            {
                this.folioField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Section
        {
            get
            {
                return this.sectionField;
            }
            set
            {
                this.sectionField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string Volume
        {
            get
            {
                return this.volumeField;
            }
            set
            {
                this.volumeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AdditionalRegistrationData
        {
            get
            {
                return this.additionalRegistrationDataField;
            }
            set
            {
                this.additionalRegistrationDataField = value;
            }
        }
    }


    /// <summary>
    /// Clase que representa al bloque Parties dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class PartiesType
    {
        /// <summary>
        /// emisor o proveedor de la factura
        /// </summary>
        private BusinessType sellerPartyField;

        /// <summary>
        /// receptor o cliente de la factura
        /// </summary>
        private BusinessType buyerPartyField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public BusinessType SellerParty
        {
            get
            {
                return this.sellerPartyField;
            }
            set
            {
                this.sellerPartyField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public BusinessType BuyerParty
        {
            get
            {
                return this.buyerPartyField;
            }
            set
            {
                this.buyerPartyField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa al bloque PaymentDetails dentro de la facturae
    /// </summary>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class PaymentDetailsType
    {
        /// <summary>
        /// Fecha en la que se debe efectuar el pago
        /// </summary>
        private DateTime assignmentDuePaymentDateField;

        /// <summary>
        /// Medio de pago asignado 
        /// </summary>
        private string assignmentPaymentMeansField;

        /// <summary>
        /// Identificacion de la cuenta donde se cancelará, en formato europeo
        /// </summary>
        private string iBANField;

        private string paymentReferenceField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified, DataType = "date")]
        public DateTime AssignmentDuePaymentDate
        {
            get
            {
                return this.assignmentDuePaymentDateField;
            }
            set
            {
                this.assignmentDuePaymentDateField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string AssignmentPaymentMeans
        {
            get
            {
                return this.assignmentPaymentMeansField;
            }
            set
            {
                this.assignmentPaymentMeansField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string IBAN
        {
            get
            {
                return this.iBANField;
            }
            set
            {
                this.iBANField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string PaymentReference
        {
            get
            {
                return this.paymentReferenceField;
            }
            set
            {
                this.paymentReferenceField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class AssigneeType
    {

        private TaxIdentificationType taxIdentificationField;

        private object itemField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public TaxIdentificationType TaxIdentification
        {
            get
            {
                return this.taxIdentificationField;
            }
            set
            {
                this.taxIdentificationField = value;
            }
        }


        [XmlElementAttribute("Individual", typeof(IndividualType), Form = XmlSchemaForm.Unqualified)]
        [XmlElementAttribute("LegalEntity", typeof(LegalEntityType), Form = XmlSchemaForm.Unqualified)]
        public object Item
        {
            get
            {
                return this.itemField;
            }
            set
            {
                this.itemField = value;
            }
        }
    }


    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class FactoringAssignmentDataType
    {

        private AssigneeType assigneeField;

        private PaymentDetailsType paymentDetailsField;

        private string factoringAssignmentClausesField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AssigneeType Assignee
        {
            get
            {
                return this.assigneeField;
            }
            set
            {
                this.assigneeField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public PaymentDetailsType PaymentDetails
        {
            get
            {
                return this.paymentDetailsField;
            }
            set
            {
                this.paymentDetailsField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string FactoringAssignmentClauses
        {
            get
            {
                return this.factoringAssignmentClausesField;
            }
            set
            {
                this.factoringAssignmentClausesField = value;
            }
        }
    }

    /// <summary>
    /// Clase que representa el bloque Batch dentro de la facturae
    /// </summary>
    /// <remarks>Recoge informacion del conjunto de facturas dentro del factura. En este caso solamente
    /// es una factura, por lo que los datos de los totales en esta sección, deben corresponder al bloque invoiceTotals</remarks>
    [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
    [SerializableAttribute()]
    [DebuggerStepThroughAttribute()]
    [DesignerCategoryAttribute("code")]
    [XmlTypeAttribute(Namespace = "http://www.facturae.es/Facturae/2007/v3.1/Facturae")]
    public partial class BatchType
    {
        /// <summary>
        /// identificador del lote de facturas, 
        /// es una concatenacion del valor TaxIdentificationNumber de issuerParty + el número o secuencia de la primer factura + la seria de la misma
        /// </summary>
        private string batchIdentifierField;

        /// <summary>
        /// cantidad de facturas presentes en el documento de facturae, para este caso siempre será 1, ya que la modalidad = I (individual)
        /// </summary>
        private long invoicesCountField;

        /// <summary>
        /// en este caso debe corresponder al invoiceTotal del bloque InvoiceTotals de la primer factura del listado
        /// </summary>
        private AmountType totalInvoicesAmountField;

        /// <summary>
        /// en este caso debe corresponder al invoiceTotal del bloque InvoiceTotals de la primer factura del listado
        /// </summary>
        private AmountType totalOutstandingAmountField;

        /// <summary>
        /// en este caso debe corresponder al invoiceTotal del bloque InvoiceTotals de la primer factura del listado
        /// </summary>
        private AmountType totalExecutableAmountField;

        /// <summary>
        /// tipo de moneda en el que se genera la factura
        /// </summary>
        private CurrencyCodeType invoiceCurrencyCodeField;


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public string BatchIdentifier
        {
            get
            {
                return this.batchIdentifierField;
            }
            set
            {
                this.batchIdentifierField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public long InvoicesCount
        {
            get
            {
                return this.invoicesCountField;
            }
            set
            {
                this.invoicesCountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TotalInvoicesAmount
        {
            get
            {
                return this.totalInvoicesAmountField;
            }
            set
            {
                this.totalInvoicesAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TotalOutstandingAmount
        {
            get
            {
                return this.totalOutstandingAmountField;
            }
            set
            {
                this.totalOutstandingAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public AmountType TotalExecutableAmount
        {
            get
            {
                return this.totalExecutableAmountField;
            }
            set
            {
                this.totalExecutableAmountField = value;
            }
        }


        [XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
        public CurrencyCodeType InvoiceCurrencyCode
        {
            get
            {
                return this.invoiceCurrencyCodeField;
            }
            set
            {
                this.invoiceCurrencyCodeField = value;
            }
        }




    }
}
